From e46ff83f307b39c113c151018c401e83f61d6e9e Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 13 Jan 2009 14:04:27 +0000 Subject: [PATCH] Bug 164002 - query scripts don't work uninstalled on windows 2009-01-13 Tor Lillqvist Bug 164002 - query scripts don't work uninstalled on windows * gtk/gtkmain.c (_gtk_get_libdir): If the gtk DLL is in a ".libs" folder, assume we are running uninstalled, and use the configure-time GTK_LIBDIR. svn path=/trunk/; revision=22110 --- ChangeLog | 8 ++++++++ gtk/gtkmain.c | 37 +++++++++++++++++++++---------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b6b00525a..4f49b9ddd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-13 Tor Lillqvist + + Bug 164002 - query scripts don't work uninstalled on windows + + * gtk/gtkmain.c (_gtk_get_libdir): If the gtk DLL is in a ".libs" + folder, assume we are running uninstalled, and use the + configure-time GTK_LIBDIR. + 2009-01-12 Matthias Clasen * NEWS: Refer to tray icon spec, instead of a random email. diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index fb5d35af7d..11aee08fbc 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -85,9 +85,28 @@ DllMain (HINSTANCE hinstDLL, return TRUE; } -/* This here before inclusion of gtkprivate.h so that it sees the - * original GTK_LOCALEDIR definition. Yeah, this is a bit sucky. +/* These here before inclusion of gtkprivate.h so that the original + * GTK_LIBDIR and GTK_LOCALEDIR definitions are seen. Yeah, this is a + * bit sucky. */ +const gchar * +_gtk_get_libdir (void) +{ + static char *gtk_libdir = NULL; + if (gtk_libdir == NULL) + { + gchar *root = g_win32_get_package_installation_directory_of_module (gtk_dll); + gchar *slash = strrchr (root, '\\'); + if (g_ascii_strcasecmp (slash + 1, ".libs") == 0) + gtk_libdir = GTK_LIBDIR; + else + gtk_libdir = g_build_filename (root, "lib", NULL); + g_free (root); + } + + return gtk_libdir; +} + const gchar * _gtk_get_localedir (void) { @@ -332,20 +351,6 @@ _gtk_get_datadir (void) return gtk_datadir; } -const gchar * -_gtk_get_libdir (void) -{ - static char *gtk_libdir = NULL; - if (gtk_libdir == NULL) - { - gchar *root = g_win32_get_package_installation_directory_of_module (gtk_dll); - gtk_libdir = g_build_filename (root, "lib", NULL); - g_free (root); - } - - return gtk_libdir; -} - const gchar * _gtk_get_sysconfdir (void) { -- 2.30.2